<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>工序物料设计审核</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/bootstraptable/bootstrap-table.css" rel="stylesheet">
    <style>
        .text_no_border{
            border: none;
        }
    </style>
</head>
<body>
<div style="color: #0e9aef;margin: 20px;">您正在做的业务是：生产管理--工序物料设计--工序物料设计单审核</div>

<div class="container">
    <form class="form-horizontal" id="process_details_form">
        <div style="text-align: right">
            <label class="radio-inline">
                <input type="radio" name="designModuleTag" value="G002-0">未通过
            </label>
            <label class="radio-inline">
                <input type="radio" name="designModuleTag" value="G002-2">通过
            </label>
            <button type="button" id="sure_btn" class="btn btn-default">确认</button>
            <button type="button" class="btn btn-default" onclick="history.back(-1);">返回</button>
        </div>
        <div class="panel panel-default" style="margin-top: 5px;">
            <div class="page-heading">
                <div class="panel-title">
                    <h2 style="text-align: center;">工序物料设计单</h2>
                </div>
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="control-label col-md-4">工序单编号：</label>
                        <div class="col-md-8">
                            <input type="text" readonly class="form-control text_no_border"
                                   style="background-color: white" name="designId" id="designId" />
                            <input type="hidden" name="id" id="id">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="control-label col-md-4">设计人：</label>
                        <div class="col-md-8">
                            <input type="text" readonly class="form-control text_no_border"
                                   style="background-color: white" name="designer" id="designer" />
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="control-label col-md-4">产品名称：</label>
                        <div class="col-md-8">
                            <input type="text" readonly class="form-control text_no_border"
                                   style="background-color: white" name="productName" id="productName" />
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="control-label col-md-4">产品编号：</label>
                        <div class="col-md-8">
                            <input type="text" readonly class="form-control text_no_border"
                                   style="background-color: white" name="productId" id="productId" />
                        </div>
                    </div>
                </div>
                <!--工序明细-->
                <table style="margin-top: 20px;" class="table table-bordered table-striped" data-toggle="table" id="process_details_table">
                    <thead>
                    <th data-field="detailsNumber">序号</th>
                    <th data-field="procedureName">工序名称</th>
                    <th data-field="procedureId">工序编号</th>
                    <th data-field="procedureDescribe">描述</th>
                    <th data-field="labourHourAmount">工时数</th>
                    <th data-field="subtotal">工时成本小计（元）</th>
                    <th data-field="moduleSubtotal">物料成本小计</th>
                    <th data-field="audit" data-formatter="formatterAudit">审核</th>
                    </thead>
                </table>
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="control-label col-md-4">工时总成本：</label>
                        <div class="col-md-8">
                            <input type="text" readonly class="form-control text_no_border"
                                   style="background-color: white" name="costPriceSum" id="costPriceSum" />
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="control-label col-md-4">物料总成本：</label>
                        <div class="col-md-8">
                            <input type="text" readonly class="form-control text_no_border"
                                   style="background-color: white" name="moduleCostPriceSum" id="moduleCostPriceSum" />
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">设计要求：</label>
                        <div class="col-md-8">
                           <textarea class="form-control" name="procedureDescribe" id="procedureDescribe" readonly style="background-color: white;border: none;resize: none;" rows="2" cols="50">

                           </textarea>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">审核人：</label>
                        <div class="col-md-8">
                            <input class="form-control" type="text" readonly
                                   style="background-color: white;border: none;border-bottom: 1px solid black;"
                                   name="checker" id="checker">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">审核时间：</label>
                        <div class="col-md-8">
                            <input class="form-control" type="text" readonly
                                   style="background-color: white;border: none;" name="checkTime" id="checkTime">
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="control-label col-md-4">审核意见：</label>
                        <div class="col-md-8">
                            <textarea class="form-control" style="resize: none" rows="2" cols="50"
                                      name="checkSuggestion" id="checkSuggestion">

                            </textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>


<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/js/plugins/layer/layer.min.js"></script>

<!-- 自定义js -->
<script src="/js/hAdmin.js?v=4.1.0"></script>
<script src="/js/currentTime.js"></script>

<!-- 第三方插件 -->
<script src="/js/plugins/pace/pace.min.js"></script>

<!--BootstrapTable-->
<script src="/bootstraptable/bootstrap-table.min.js"></script>
<script src="/bootstraptable/locale/bootstrap-table-zh-CN.min.js"></script>

<script>
    $(function (){
        //得到工序设计单id
        let id=localStorage.getItem("id")

        $.post("/manufacture/process/getIdQueryProcedure",{"id":id},function (res){
            $("#process_details_form #designId").val(res.designId)
            $("#process_details_form #id").val(res.id)
            $("#process_details_form #designer").val(res.designer)
            $("#process_details_form #productName").val(res.productName)
            $("#process_details_form #productId").val(res.productId)
            $("#process_details_form #costPriceSum").val(res.costPriceSum)
            $("#process_details_form #moduleCostPriceSum").val(res.moduleCostPriceSum)
            $("#process_details_form #procedureDescribe").val(res.procedureDescribe)
            $("#process_details_form #checker").val(res.checker)
            $("#process_details_form #checkTime").val(formater(res.checkTime))
            $("#process_details_form #checkSuggestion").val(res.checkSuggestion)
            $("#process_details_form #checkSuggestion").val(res.checkSuggestion)
        })
        $.post("/manufacture/process/getIdQueryDetails",{"id":id},function (res){
            for (let i=0;i<res.length;i++){
                $("#process_details_form #process_details_table").bootstrapTable("append",res[i])
            }
        })

        //点击确定按钮
        $("#process_details_form #sure_btn").click(function (){
            //获取选中的按钮
            let btn=$(":radio[name=designModuleTag]:checked")
            if(btn.length==0){
                alert("请选择审核状态")
                return
            }
            let parms=$("#process_details_form").serialize()
            $.post("/manufacture/process/updateProcedureTag",parms,function (res){
                if(res){
                    window.location="manufacture_process_material_review_queryUI"
                }
            })
        })
    })

    function formatterAudit(value,row,index){
        return `<a href='javascript:aduitInfo(${row.procedureId})'>审核</a>`
    }

    //点击审核查询
    function aduitInfo(procedureId){
        localStorage.setItem("procedureId",procedureId)
        localStorage.setItem("productId",$("#process_details_form #productId").val())
        window.location="manufacture_approve_inquiry_operation_materialUI"
    }
</script>
</body>
</html>